Dominant gradient method for finding focused objects

ABSTRACT

The dominant gradient method for finding focused objects determines focused objects within an image or video frame using a dominant gradient method. The method also uses a segmentation map of the image to determine parameters which are used in ranking the objects based on their focus. The ranking of the objects is able to be used to assist in enhancing the image, encoding the image and adjusting the lens while capturing the image.

FIELD OF THE INVENTION

The present invention relates to the field of image/video focusing andencoding. More specifically, the present invention relates to enhancingthe focusing and encoding of images/video by determining focused areasof the images/video.

BACKGROUND OF THE INVENTION

A video sequence consists of a number of pictures, usually calledframes. Subsequent frames are very similar, thus containing a lot ofredundancy from one frame to the next. Before being efficientlytransmitted over a channel or stored in memory, video data is compressedto conserve both bandwidth and memory. The goal is to remove theredundancy to gain better compression ratios. A first video compressionapproach is to subtract a reference frame from a given frame to generatea relative difference. A compressed frame contains less information thanthe reference frame. The relative difference can be encoded at a lowerbit-rate with the same quality. The decoder reconstructs the originalframe by adding the relative difference to the reference frame.

A more sophisticated approach is to approximate the motion of the wholescene and the objects of a video sequence. The motion is described byparameters that are encoded in the bit-stream. Pixels of the predictedframe are approximated by appropriately translated pixels of thereference frame. This approach provides an improved predictive abilitythan a simple subtraction. However, the bit-rate occupied by theparameters of the motion model must not become too large.

In general, video compression is performed according to many standards,including one or more standards for audio and video compression from theMoving Picture Experts Group (MPEG), such as MPEG-1, MPEG-2, and MPEG-4.Additional enhancements have been made as part of the MPEG-4 part 10standard, also referred to as H.264, or AVC (Advanced Video Coding).Under the MPEG standards, video data is first encoded (e.g. compressed)and then stored in an encoder buffer on an encoder side of a videosystem. Later, the encoded data is transmitted to a decoder side of thevideo system, where it is stored in a decoder buffer, before beingdecoded so that the corresponding pictures can be viewed.

The intent of the H.264/AVC project was to develop a standard capable ofproviding good video quality at bit rates that are substantially lowerthan what previous standards would need (e.g. MPEG-2, H.263, or MPEG-4Part 2). Furthermore, it was desired to make these improvements withoutsuch a large increase in complexity that the design is impractical toimplement. An additional goal was to make these changes in a flexibleway that would allow the standard to be applied to a wide variety ofapplications such that it could be used for both low and high bit ratesand low and high resolution video. Another objective was that it wouldwork well on a very wide variety of networks and systems.

H.264/AVC/MPEG-4 Part 10 contains many new features that allow it tocompress video much more effectively than older standards and to providemore flexibility for application to a wide variety of networkenvironments. Some key features include multi-picture motioncompensation using previously-encoded pictures as references, variableblock-size motion compensation (VBSMC) with block sizes as large as16×16 and as small as 4×4, six-tap filtering for derivation of half-pelluma sample predictions, macroblock pair structure, quarter-pixelprecision for motion compensation, weighted prediction, an in-loopdeblocking filter, an exact-match integer 4×4 spatial block transform, asecondary Hadamard transform performed on “DC” coefficients of theprimary spatial transform wherein the Hadamard transform is similar to afast Fourier transform, spatial prediction from the edges of neighboringblocks for “intra” coding, context-adaptive binary arithmetic coding(CABAC), context-adaptive variable-length coding (CAVLC), a simple andhighly-structured variable length coding (VLC) technique for many of thesyntax elements not coded by CABAC or CAVLC, referred to asExponential-Golomb coding, a network abstraction layer (NAL) definition,switching slices, flexible macroblock ordering, redundant slices (RS),supplemental enhancement information (SEI) and video usabilityinformation (VUI), auxiliary pictures, frame numbering and picture ordercount. These techniques, and several others, allow H.264 to performsignificantly better than prior standards, and under more circumstancesand in more environments. H.264 usually performs better than MPEG-2video by obtaining the same quality at half of the bit rate or evenless.

MPEG is used for the generic coding of moving pictures and associatedaudio and creates a compressed video bit-stream made up of a series ofthree types of encoded data frames. The three types of data frames arean intra frame (called an I-frame or I-picture), a bi-directionalpredicated frame (called a B-frame or B-picture), and a forwardpredicted frame (called a P-frame or P-picture). These three types offrames can be arranged in a specified order called the GOP (Group OfPictures) structure. I-frames contain all the information needed toreconstruct a picture. The I-frame is encoded as a normal image withoutmotion compensation. On the other hand, P-frames use information fromprevious frames and B-frames use information from previous frames, asubsequent frame, or both to reconstruct a picture. Specifically,P-frames are predicted from a preceding I-frame or the immediatelypreceding P-frame.

Frames can also be predicted from the immediate subsequent frame. Inorder for the subsequent frame to be utilized in this way, thesubsequent frame must be encoded before the predicted frame. Thus, theencoding order does not necessarily match the real frame order. Suchframes are usually predicted from two directions, for example from theI- or P-frames that immediately precede or the P-frame that immediatelyfollows the predicted frame. These bidirectionally predicted frames arecalled B-frames.

There are many possible GOP structures. A common GOP structure is 15frames long, and has the sequence I_BB_P_BB_P_BB_P_BB_P_BB_. A similar12-frame sequence is also common. I-frames encode for spatialredundancy, P and B-frames for both temporal redundancy and spatialredundancy. Because adjacent frames in a video stream are oftenwell-correlated, P-frames and B-frames are only a small percentage ofthe size of I-frames. However, there is a trade-off between the size towhich a frame can be compressed versus the processing time and resourcesrequired to encode such a compressed frame. The ratio of I, P andB-frames in the GOP structure is determined by the nature of the videostream and the bandwidth constraints on the output stream, althoughencoding time may also be an issue. This is particularly true in livetransmission and in real-time environments with limited computingresources, as a stream containing many B-frames can take much longer toencode than an I-frame-only file.

B-frames and P-frames require fewer bits to store picture data,generally containing difference bits for the difference between thecurrent frame and a previous frame, subsequent frame, or both. B-framesand P-frames are thus used to reduce redundancy information containedacross frames. In operation, a decoder receives an encoded B-frame orencoded P-frame and uses a previous or subsequent frame to reconstructthe original frame. This process is much easier and produces smootherscene transitions when sequential frames are substantially similar,since the difference in the frames is small.

Each video image is separated into one luminance (Y) and two chrominancechannels (also called color difference signals Cb and Cr). Blocks of theluminance and chrominance arrays are organized into “macroblocks,” whichare the basic unit of coding within a frame.

In the case of I-frames, the actual image data is passed through anencoding process. However, P-frames and B-frames are first subjected toa process of “motion compensation.” Motion compensation is a way ofdescribing the difference between consecutive frames in terms of whereeach macroblock of the former frame has moved. Such a technique is oftenemployed to reduce temporal redundancy of a video sequence for videocompression. Each macroblock in the P-frames or B-frame is associatedwith an area in the previous or next image that it is well-correlated,as selected by the encoder using a “motion vector.” The motion vectorthat maps the macroblock to its correlated area is encoded, and then thedifference between the two areas is passed through the encoding process.

Conventional video codecs use motion compensated prediction toefficiently encode a raw input video stream. The macroblock in thecurrent frame is predicted from a displaced macroblock in the previousframe. The difference between the original macroblock and its predictionis compressed and transmitted along with the displacement (motion)vectors. This technique is referred to as inter-coding, which is theapproach used in the MPEG standards.

One of the most time-consuming components within the encoding process ismotion estimation. Motion estimation is utilized to reduce the bit rateof video signals by implementing motion compensated prediction incombination with transform coding of the prediction error. Motionestimation-related aliasing is not able to be avoided by usinginter-pixel motion estimation, and the aliasing deteriorates theprediction efficiency. In order to solve the deterioration problem,half-pixel interpolation and quarter-pixel interpolation are adapted forreducing the impact of aliasing. To estimate a motion vector withquarter-pixel accuracy, a three step search is generally used. In thefirst step, motion estimation is applied within a specified search rangeto each integer pixel to find the best match. Then, in the second step,eight half-pixel points around the selected integer-pixel motion vectorare examined to find the best half-pixel matching point. Finally, in thethird step, eight quarter-pixel points around the selected half-pixelmotion vector are examined, and the best matching point is selected asthe final motion vector. Considering the complexity of the motionestimation, the integer-pixel motion estimation takes a major portion ofmotion estimation if a full-search is used for integer-pixel motionestimation. However, if a fast integer motion estimation algorithm isutilized, an integer-pixel motion vector is able to be found byexamining less than ten search points. As a consequence, the computationcomplexity of searching the half-pixel motion vector and quarter-pixelmotion vector becomes dominant.

Further, determining the focused components of an image or video hasbeen used in image recognition such as to help distinguish objects suchas faces and even characterize the importance of the objects within theimage.

SUMMARY OF THE INVENTION

The dominant gradient method for finding focused objects determinesfocused objects within an image or video frame using a dominant gradientmethod. The method also uses a segmentation map of the image todetermine parameters which are used in ranking the objects based ontheir focus. The ranking of the objects is able to be used to assist inenhancing the image, encoding the image and adjusting the lens whilecapturing the image.

In one aspect, a method of determining a focused object utilizing acomputing device comprises calculating a dominant gradient map,calculating a boundary for each object within a segmentation map,thickening the boundary for each object, calculating one or moreparameters for each object and ranking the objects based on the one ormore parameters. The focused object is contained in one of an image anda video frame. Calculating a dominant gradient map further comprisescomputing a gradient at each pixel, defining a window around each pixel,calculating a slope of the gradient at each pixel and selecting adominant gradient factor based on the slope of the gradient at eachpixel. The method further comprises refining the segmentation map.Refining includes at least one of marking disconnected regions of sameobjects as separate objects, merging objects with areas smaller than aspecified number of pixels with a closest object and generating asecondary binary dominant gradient map using the dominant gradient mapand morphological dilation. The method further comprises reordering thesegmentation map. An object at the top of the rankings is the mostfocused object. The one or more parameters includes a least one of aperimeter of each object, an average focus factor and a uniformity focusfactor. The objects with a high average focus factor and a highuniformity focus factor are focused objects. The computing device isselected from the group consisting of a personal computer, a laptopcomputer, a computer workstation, a server, a mainframe computer, ahandheld computer, a personal digital assistant, a cellular/mobiletelephone, a smart appliance, a gaming console, a digital camera, adigital camcorder, a camera phone, an iPod®, a video player, a DVDwriter/player, a television and a home entertainment system.

In another aspect, a method of determining a focused object utilizing acomputing device comprises calculating a dominant gradient map, refininga segmentation map, reordering the segmentation map, calculating aboundary for each object within the segmentation map, thickening theboundary for each object, calculating one or more parameters for eachobject and ranking the objects based on the one or more parameters. Thefocused object is contained in one of an image and a video frame.Calculating a dominant gradient map further comprises computing agradient at each pixel, defining a window around each pixel, calculatinga slope of the gradient at each pixel and selecting a dominant gradientfactor based on the slope of the gradient at each pixel. Refiningincludes at least one of marking disconnected regions of same objects asseparate objects, merging objects with areas smaller than a specifiednumber of pixels with a closest object and generating a secondary binarydominant gradient map using the dominant gradient map and morphologicaldilation. An object at the top of the rankings is the most focusedobject. The one or more parameters includes a least one of a perimeterof each object, an average focus factor and a uniformity focus factor.Objects with a high average focus factor and a high uniformity focusfactor are focused objects. The computing device is selected from thegroup consisting of a personal computer, a laptop computer, a computerworkstation, a server, a mainframe computer, a handheld computer, apersonal digital assistant, a cellular/mobile telephone, a smartappliance, a gaming console, a digital camera, a digital camcorder, acamera phone, an iPod®, a video player, a DVD writer/player, atelevision and a home entertainment system.

In another aspect, a device for determining a focused object utilizing acomputing device comprises a memory for storing an application, theapplication configured for calculating a dominant gradient map,calculating a boundary for each object within a segmentation map,thickening the boundary for each object, calculating one or moreparameters for each object and ranking the objects based on the one ormore parameters and a processing component coupled to the memory, theprocessing component configured for processing the application. Thefocused object is contained in one of an image and a video frame.Calculating a dominant gradient map further comprises computing agradient at each pixel, defining a window around each pixel, calculatinga slope of the gradient at each pixel and selecting a dominant gradientfactor based on the slope of the gradient at each pixel. The applicationis further configured for refining the segmentation map. Refiningincludes at least one of marking disconnected regions of same objects asseparate objects, merging objects with areas smaller than a specifiednumber of pixels with a closest object and generating a secondary binarydominant gradient map using the dominant gradient map and morphologicaldilation. The application is further configured for reordering thesegmentation map. An object at the top of the rankings is the mostfocused object. The one or more parameters includes a least one of aperimeter of each object, an average focus factor and a uniformity focusfactor. Objects with a high average focus factor and a high uniformityfocus factor are focused objects. The device captures one of an imageand a video.

In another aspect, an application for determining a focused objectimplemented by a computing device comprises a dominant gradientcomponent configured for calculating a dominant gradient map, asegmentation map component operatively coupled to the dominant gradientcomponent, the segmentation map component configured for refining asegmentation map and reordering the segmentation map, a boundarycomponent operatively coupled to the segmentation map component, theboundary component configured for calculating a boundary for each objectand thickening the boundary for each object, a parameter componentoperatively coupled to the boundary component, the parameter componentconfigured for calculating one or more parameters and a rankingcomponent operatively coupled to the parameter component, the rankingcomponent for ranking the objects according to the one or moreparameters. Refining the segmentation map includes at least one ofmarking disconnected regions of same objects as separate objects,merging objects with areas smaller than a specified number of pixelswith a closest object and generating a secondary binary dominantgradient map using the dominant gradient map and morphological dilation.An object at the top of the rankings is the most focused object. The oneor more parameters includes a least one of a perimeter of each object,an average focus factor and a uniformity focus factor. Objects with ahigh average focus factor and a high uniformity focus factor are focusedobjects. The computing device is selected from the group consisting of apersonal computer, a laptop computer, a computer workstation, a server,a mainframe computer, a handheld computer, a personal digital assistant,a cellular/mobile telephone, a smart appliance, a gaming console, adigital camera, a digital camcorder, a camera phone, an iPod®, a videoplayer, a DVD writer/player, a television and a home entertainmentsystem.

In another aspect, a network of devices comprises a recording device anda computing device coupled to the recording device, wherein thecomputing device and the recording device each contain a memory forstoring an application, the application configured for calculating adominant gradient map, calculating a boundary for each object within asegmentation map, thickening the boundary for each object, calculatingone or more parameters for each object and ranking the objects based onthe one or more parameters and a processing component coupled to thememory, the processing component configured for processing theapplication. Calculating a dominant gradient map further comprisescomputing a gradient at each pixel, defining a window around each pixel,calculating a slope of the gradient at each pixel and selecting adominant gradient factor based on the slope of the gradient at eachpixel. The application is further configured for refining thesegmentation map. Refining includes at least one of marking disconnectedregions of same objects as separate objects, merging objects with areassmaller than a specified number of pixels with a closest object andgenerating a secondary binary dominant gradient map using the dominantgradient map and morphological dilation. The application is furtherconfigured for reordering the segmentation map. An object at the top ofthe rankings is the most focused object. The one or more parametersincludes a least one of a perimeter of each object, an average focusfactor and a uniformity focus factor. Objects with a high average focusfactor and a high uniformity focus factor are focused objects. Therecording device captures one of an image and a video. The computingdevice displays one of an image and a video.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a flowchart of implementing the dominant gradientmethod.

FIG. 2 illustrates a flowchart of a method of utilizing the dominantgradient to find focused objects.

FIG. 3 illustrates a block diagram of an exemplary computing device.

FIG. 4 illustrates a block diagram of a computing device.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

A Dominant Gradient (DG) method works based on the theory that a focusedobject in a scene of an image or video has a sharp edge (if any) andthere is no significant transition around the sharp edge because blurareas tend to have multiple rings/variations around the sharp edge dueto being out of focus.

FIG. 1 illustrates a flowchart of implementing the DG method. Based onthe above idea, a gradient is computed at each pixel of the input image,in the step 100. The gradient is able to be of L1, L2 or L(N) norm inwhich N is a real number. Then, in the step 102, a window orneighborhood of size W around each pixel is defined. For each directionin that window, where the number of directions depends on the size ofthe window, the slope of the gradient at each side of a pixel iscalculated, in the step 104. The slope is calculated by determining thedifference between the gradient at the center of a window and the mostoutward pixel at each side of the direction in that window, and thenthat difference is divided by the distance between the two pixels. Thedistance is able to be calculated based on L1, L2 or L(N) norm, again Nbeing a real number. The slope for all possible directions iscalculated, and then the maximum value of all of the values calculatedis chosen as the Dominant Gradient Factor for that specific pixel, inthe step 106. In the step 108, a map equal to the size of the image isgenerated in which each value represents the focus-ness degree of thecorresponding pixel in the input image. The highest value is the mostfocused pixel, and the lowest value is the least focused pixel.

In some embodiments, the pixels are able to be ranked from the mostfocused to the least focused, and a specified percentage are able to bechosen. The chosen pixels correspond to a certain percentage of edgepixels in and around the depth of field.

The DG method provides a simple consistent method of finding the mostfocused pixels in an image and ranking them.

FIG. 2 illustrates a flowchart of a method of utilizing the dominantgradient to find focused objects. For an input image or frame of video,along with its received or computed segmentation map, the followingsteps are performed. The segmentation map is generated from eachsegmented object identifying the location and boundaries of each objectin the original image. For example, a segmentation map is able to be abinary image where the object is white and everything else is black.Each of the objects in the original image are also identified as beingin the foreground or in the background. In the step 200, a DG map iscalculated for the image or frame. In the step 202, in some embodiments,the segmentation map is refined by marking disconnected regions of sameobjects as separate objects, merging objects with areas smaller than aspecified number of pixels with the closest object and generating asecondary binary DG map using the DG map and morphological dilation. TheDG map is continuous and rigid, and the binary map is crossed with thesegmentation map. If the DG map includes a large object in thesegmentation map, that object is broken up into two objects withboundaries at the areas that the DG crosses. In the step 204, in someembodiments, the segmentation map is reordered from objects with thelargest area to objects with the smallest area. In the step 206, usingmorphological operations, a boundary for each object is calculated. Inthe step 208, using morphological dilation, the boundary is thickened toa certain degree. The degree is dependent on the size and shape of thedilation element. In the step 210, several parameters are calculated foreach object. In some embodiments, the parameters calculated include theperimeter of each object, the Average Focus Factor (AFF) which is themean value of DG values which cross the thickened border and theUniformity Focus Factor (UFF) which is the ratio of the AFF to themaximum DG value that crosses the border of each object. In the step212, the objects are ranked based on their AFF in descending order.Objects with a high AFF and a high UFF are the objects located in thedepth of field of the image or frame and are highly focused. Objectswith a low AFF and a low UFF are either objects that are extendedoutside of the field of depth or are objects that are not focused onwell. In some embodiments, output after the rankings includes the rankedobjects based on their focus.

FIG. 3 illustrates a block diagram of an exemplary computing device 300configured to implement the DG method for finding focused objects. Thecomputing device 300 is able to be used to acquire, store, compute,communicate and/or display information such as images and videos. Forexample, a computing device 300 acquires a video, and then the DG methodfor finding focused objects is able to classify the image/frames, findareas of focus in the image/frames, focus a lens of the device and/orenhance the image/frames, in addition to other uses. In general, ahardware structure suitable for implementing the computing device 300includes a network interface 302, a memory 304, a processor 306, I/Odevice(s) 308, a bus 310 and a storage device 312. The choice ofprocessor is not critical as long as a suitable processor withsufficient speed is chosen. The memory 304 is able to be anyconventional computer memory known in the art. The storage device 312 isable to include a hard drive, CDROM, CDRW, DVD, DVDRW, flash memory cardor any other storage device. The computing device 300 is able to includeone or more network interfaces 302. An example of a network interfaceincludes a network card connected to an Ethernet or other type of LAN.The I/O device(s) 308 are able to include one or more of the following:keyboard, mouse, monitor, display, printer, modem, touchscreen, buttoninterface and other devices. DG application(s) 330 used to perform theDG focusing method are likely to be stored in the storage device 312 andmemory 304 and processed as applications are typically processed. Moreor less components shown in FIG. 3 are able to be included in thecomputing device 300. In some embodiments, DG focusing hardware 320 isincluded. Although the computing device 300 in FIG. 3 includesapplications 330 and hardware 320 for DG focusing, the DG focusingmethod is able to be implemented on a computing device in hardware,firmware, software or any combination thereof.

In some embodiments, the DG application(s) 330 include severalapplications and/or components. In some embodiments, the DGapplication(s) 330 include a dominant gradient component 332, asegmentation map component 334, a boundary component 336, a parametercomponent 338 and a ranking component 340. The dominant gradientcomponent 332 is configured for calculating a dominant gradient map. Thesegmentation map component 334 is configured for refining a segmentationmap and reordering the segmentation map. The boundary component 336calculates a boundary for each object within an image/frame and thickensthe object's boundary. The parameter component 338 calculates one ormore parameters for each object such as the AFF and UFF. The rankingcomponent 340 ranks the objects according to the parameters.

Examples of suitable computing devices include a personal computer, alaptop computer, a computer workstation, a server, a mainframe computer,a handheld computer, a personal digital assistant, a cellular/mobiletelephone, a smart appliance, a gaming console, a digital camera, adigital camcorder, a camera phone, an iPod®, a video player, a DVDwriter/player, a television, a home entertainment system or any othersuitable computing device.

FIG. 4 illustrates a block diagram of a computing device 400 such as acamcorder implementing the DG method. Exemplary uses of the camcorderimplementing the DG method include acquiring a video such as a video ofa wedding celebration with improved focusing from the DG method, andthen finding areas of interest with the DG method for video encoding.The camcorder is shown with DG applications 330 and DG hardware 320. Asdescribed above, the DG method is able to be implemented in software,firmware, hardware or any combination thereof.

To utilize the DG method for finding focused objects, a computing deviceoperates as usual, but the focusing process, encoding process and/orclassification process is improved in that it is more efficient and moreaccurate by implementing the DG method for finding focused objects. Theutilization of the computing device from the user's perspective issimilar or the same as one that uses standard encoding. For example, theuser still simply turns on a digital camcorder and uses the camcorder torecord a video. The DG method is able to automatically improve thefocusing, encoding and/or classification process without userintervention. The DG method is able to be used anywhere that requiresimage capture and/or video encoding. Many applications are able toutilize the DG method for finding focused objects.

In operation, the DG method for finding focused objects enables manyimprovements related to image/video acquisition, encoding andclassification. The consistency of the measure, the ability to separatethe foreground from the background edges and to identify the mostimportant part of the image are significant improvements. There areseveral uses for the dominant gradient method for finding focusedobjects including, but not limited to, classification of an input imageor video for detecting the focused areas and the most important areas ofthe input, image coding and video coding for finding the areas ofinterest and/or allocating more bit budget during the encoding of thatarea, focusing a lens during the capture of an image or video bychanging the lens' focus and measuring the level of focus on differentareas of a scene and enhancing images and video by measuring theiroutput and providing a feedback mechanism to measure the amount ofenhancement in terms of focus-ness of the output image.

The present invention has been described in terms of specificembodiments incorporating details to facilitate the understanding ofprinciples of construction and operation of the invention. Suchreference herein to specific embodiments and details thereof is notintended to limit the scope of the claims appended hereto. It will bereadily apparent to one skilled in the art that other variousmodifications may be made in the embodiment chosen for illustrationwithout departing from the spirit and scope of the invention as definedby the claims.

1. A method of determining a focused object utilizing a computingdevice, the method comprising: a. calculating a dominant gradient map;b. calculating a boundary for each object within a segmentation map; c.thickening the boundary for each object; d. calculating one or moreparameters for each object; and e. ranking the objects based on the oneor more parameters.
 2. The method of claim 1 wherein the focused objectis contained in one of an image and a video frame.
 3. The method ofclaim 1 wherein calculating a dominant gradient map further comprises:a. computing a gradient at each pixel; b. defining a window around eachpixel; c. calculating a slope of the gradient at each pixel; and d.selecting a dominant gradient factor based on the slope of the gradientat each pixel.
 4. The method of claim 1 further comprising refining thesegmentation map.
 5. The method of claim 4 wherein refining includes atleast one of marking disconnected regions of same objects as separateobjects, merging objects with areas smaller than a specified number ofpixels with a closest object and generating a secondary binary dominantgradient map using the dominant gradient map and morphological dilation.6. The method of claim 1 further comprising reordering the segmentationmap.
 7. The method of claim 1 wherein an object at the top of therankings is the most focused object.
 8. The method of claim 1 whereinthe one or more parameters includes a least one of a perimeter of eachobject, an average focus factor and a uniformity focus factor.
 9. Themethod of claim 8 wherein the objects with a high average focus factorand a high uniformity focus factor are focused objects.
 10. The methodof claim 1 wherein the computing device is selected from the groupconsisting of a personal computer, a laptop computer, a computerworkstation, a server, a mainframe computer, a handheld computer, apersonal digital assistant, a cellular/mobile telephone, a smartappliance, a gaming console, a digital camera, a digital camcorder, acamera phone, an iPod®, a video player, a DVD writer/player, atelevision and a home entertainment system.
 11. A method of determininga focused object utilizing a computing device, the method comprising: a.calculating a dominant gradient map; b. refining a segmentation map; c.reordering the segmentation map; d. calculating a boundary for eachobject within the segmentation map; e. thickening the boundary for eachobject; f. calculating one or more parameters for each object; and g.ranking the objects based on the one or more parameters.
 12. The methodof claim 11 wherein the focused object is contained in one of an imageand a video frame.
 13. The method of claim 11 wherein calculating adominant gradient map further comprises: a. computing a gradient at eachpixel; b. defining a window around each pixel; c. calculating a slope ofthe gradient at each pixel; and d. selecting a dominant gradient factorbased on the slope of the gradient at each pixel.
 14. The method ofclaim 11 wherein refining includes at least one of marking disconnectedregions of same objects as separate objects, merging objects with areassmaller than a specified number of pixels with a closest object andgenerating a secondary binary dominant gradient map using the dominantgradient map and morphological dilation.
 15. The method of claim 11wherein an object at the top of the rankings is the most focused object.16. The method of claim 11 wherein the one or more parameters includes aleast one of a perimeter of each object, an average focus factor and auniformity focus factor.
 17. The method of claim 16 wherein objects witha high average focus factor and a high uniformity focus factor arefocused objects.
 18. The method of claim 11 wherein the computing deviceis selected from the group consisting of a personal computer, a laptopcomputer, a computer workstation, a server, a mainframe computer, ahandheld computer, a personal digital assistant, a cellular/mobiletelephone, a smart appliance, a gaming console, a digital camera, adigital camcorder, a camera phone, an iPod®, a video player, a DVDwriter/player, a television and a home entertainment system.
 19. Adevice for determining a focused object utilizing a computing device,the device comprising: a. a memory for storing an application, theapplication configured for: i. calculating a dominant gradient map; ii.calculating a boundary for each object within a segmentation map; iii.thickening the boundary for each object; iv. calculating one or moreparameters for each object; and v. ranking the objects based on the oneor more parameters; and b. a processing component coupled to the memory,the processing component configured for processing the application. 20.The device of claim 19 wherein the focused object is contained in one ofan image and a video frame.
 21. The device of claim 19 whereincalculating a dominant gradient map further comprises: a. computing agradient at each pixel; b. defining a window around each pixel; c.calculating a slope of the gradient at each pixel; and d. selecting adominant gradient factor based on the slope of the gradient at eachpixel.
 22. The device of claim 19 wherein the application is furtherconfigured for refining the segmentation map.
 23. The device of claim 22wherein refining includes at least one of marking disconnected regionsof same objects as separate objects, merging objects with areas smallerthan a specified number of pixels with a closest object and generating asecondary binary dominant gradient map using the dominant gradient mapand morphological dilation.
 24. The device of claim 19 wherein theapplication is further configured for reordering the segmentation map.25. The device of claim 19 wherein an object at the top of the rankingsis the most focused object.
 26. The device of claim 19 wherein the oneor more parameters includes a least one of a perimeter of each object,an average focus factor and a uniformity focus factor.
 27. The device ofclaim 26 wherein objects with a high average focus factor and a highuniformity focus factor are focused objects.
 28. The device of claim 19wherein the device captures one of an image and a video.
 29. Anapplication for determining a focused object implemented by a computingdevice, the application comprising: a. a dominant gradient componentconfigured for calculating a dominant gradient map; b. a segmentationmap component operatively coupled to the dominant gradient component,the segmentation map component configured for refining a segmentationmap and reordering the segmentation map; c. a boundary componentoperatively coupled to the segmentation map component, the boundarycomponent configured for calculating a boundary for each object andthickening the boundary for each object; d. a parameter componentoperatively coupled to the boundary component, the parameter componentconfigured for calculating one or more parameters; and e. a rankingcomponent operatively coupled to the parameter component, the rankingcomponent for ranking the objects according to the one or moreparameters.
 30. The application of claim 29 wherein refining thesegmentation map includes at least one of marking disconnected regionsof same objects as separate objects, merging objects with areas smallerthan a specified number of pixels with a closest object and generating asecondary binary dominant gradient map using the dominant gradient mapand morphological dilation.
 31. The application of claim 29 wherein anobject at the top of the rankings is the most focused object.
 32. Theapplication of claim 29 wherein the one or more parameters includes aleast one of a perimeter of each object, an average focus factor and auniformity focus factor.
 33. The application of claim 32 wherein objectswith a high average focus factor and a high uniformity focus factor arefocused objects.
 34. The application of claim 29 wherein the computingdevice is selected from the group consisting of a personal computer, alaptop computer, a computer workstation, a server, a mainframe computer,a handheld computer, a personal digital assistant, a cellular/mobiletelephone, a smart appliance, a gaming console, a digital camera, adigital camcorder, a camera phone, an iPod®, a video player, a DVDwriter/player, a television and a home entertainment system.
 35. Anetwork of devices comprising: a. a recording device; and b. a computingdevice coupled to the recording device, wherein the computing device andthe recording device each contain: i. a memory for storing anapplication, the application configured for: (1) calculating a dominantgradient map; (2) calculating a boundary for each object within asegmentation map; (3) thickening the boundary for each object; (4)calculating one or more parameters for each object; and (5) ranking theobjects based on the one or more parameters; and ii. a processingcomponent coupled to the memory, the processing component configured forprocessing the application.
 36. The network of devices of claim 35wherein calculating a dominant gradient map further comprises: a.computing a gradient at each pixel; b. defining a window around eachpixel; c. calculating a slope of the gradient at each pixel; and d.selecting a dominant gradient factor based on the slope of the gradientat each pixel.
 37. The network of devices of claim 35 wherein theapplication is further configured for refining the segmentation map. 38.The network of devices of claim 37 wherein refining includes at leastone of marking disconnected regions of same objects as separate objects,merging objects with areas smaller than a specified number of pixelswith a closest object and generating a secondary binary dominantgradient map using the dominant gradient map and morphological dilation.39. The network of devices of claim 35 wherein the application isfurther configured for reordering the segmentation map.
 40. The networkof devices of claim 35 wherein an object at the top of the rankings isthe most focused object.
 41. The network of devices of claim 35 whereinthe one or more parameters includes a least one of a perimeter of eachobject, an average focus factor and a uniformity focus factor.
 42. Thenetwork of devices of claim 41 wherein objects with a high average focusfactor and a high uniformity focus factor are focused objects.
 43. Thenetwork of devices of claim 35 wherein the recording device captures oneof an image and a video.
 44. The network of devices of claim 35 whereinthe computing device displays one of an image and a video.